package edu.sctu.jsoup;


import edu.sctu.jsoup.service.CarService;
import edu.sctu.jsoup.service.ClubService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@ComponentScan/*容器扫描，路径*/(basePackages = {"edu.sctu"})
@EnableAutoConfiguration//配置自动建库和表，和实现存储数据的功能
@EnableJpaRepositories/*配置自动建库和表，和实现存储数据的功能,属性值是repo的地址*/(basePackages = {
        "edu.sctu.jsoup.repo",
})
@EntityScan(basePackages = {
        "edu.sctu.jsoup.entity",
})
public class Application {


    public static void main(String[] args) {
        SpringApplication.run(Application.class);
    }

    @Bean//封装数据
    public CommandLineRunner demo(final CarService service) {
        return (args) -> {

            service.run();
        };
    }

}